﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CNF.Common.Base.SimpleOrm.ServiceProxyies
{
    public class BaseServiceContainer : IServiceContainer
    {
        protected Dictionary<Type, object> serviceProxy;

        public ServiceProxyType GetServiceProxyType<ServiceProxyType>() where ServiceProxyType : class
        {
            if (serviceProxy.ContainsKey(typeof(ServiceProxyType)))
            {
                return serviceProxy[typeof(ServiceProxyType)] as ServiceProxyType;
            }
            return null;
        }

        public BaseServiceContainer()
        {
            serviceProxy = new Dictionary<Type, object>();
        }
    }
}
